import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

const IS_PROD = ['production', 'test'].includes(process.env.NODE_ENV)

// https://vitejs.dev/config/
export default defineConfig({
  server:{
    host:'10.161.29.51',
    port:'9000'
  },
  plugins: [vue()],
  devServer: {
    proxy: {
      '/api': {
        target: 'http://10.161.29.86:3000/api',
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  css: {
    extract: IS_PROD,
    sourceMap: false,
    loaderOptions: {
      sass: {
        prependData: `@import "~@/assets/scss/variables.scss";`,
      },
    },
  },

})
